package  com.sat.common.base

import android.app.Application
import android.content.Context
import androidx.multidex.MultiDex

import com.tencent.mmkv.MMKV

open class BaseAPP : Application() {


    override fun onCreate() {
        super.onCreate()
        instance = this;
        MMKV.initialize(this)

    }

    companion object {
        private lateinit var instance: Application
        fun getInstance(): Application {
            return instance
        }

        fun getContext(): Context {
            return instance
        }

        fun setApplication(app: Application) {
            instance = app
        }
    }

    override fun attachBaseContext(base: Context?) {
        super.attachBaseContext(base)
        MultiDex.install(this)
    }
}